package cn.com.jd.service.impl;

import java.sql.Date;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import cn.com.jd.dao.UserInfoDtoMapper;
import cn.com.jd.model.UserInfoDto;
import cn.com.jd.service.CheckAcceleratableService;

@Service("CheckAcceleratableService")
public class CheckAcceleratableServiceImpl implements CheckAcceleratableService {
	@Resource
	private UserInfoDtoMapper userInfoDtoMapper;
	
	@Override
	public String checkAcceleratableService(String id){
		String result = "0";
		UserInfoDto userInfoDto = userInfoDtoMapper.selectByPrimaryKey(id);
		if(userInfoDto != null){
			java.util.Date utilDate = new java.util.Date();
			Date current = new Date(utilDate.getTime());
			Date expTemp = java.sql.Date.valueOf(userInfoDto.getExpireDate().toString());
			Date curTemp = java.sql.Date.valueOf(current.toString());
			if(!expTemp.before(curTemp)){
				result = "1";
			}
		}
		return result;
	}
}
